package com.heima.search.repository;

import com.heima.search.entity.ApAssociateWords;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * 操作联想词对应集合中文档 基本CURD操作
 */
public interface ApAssociateWordsRepository extends MongoRepository<ApAssociateWords, String> {

    /**
     * 根据关键字模糊查询前三条记录
     * @param key
     * @return
     */
    public List<ApAssociateWords> findTop3ByAssociateWordsLikeOrderByCreatedTimeDesc(String key);



    public List<ApAssociateWords> findTop5ByAssociateWordsContainingOrderByCreatedTime(String key);



    public List<ApAssociateWords> findFirst5ByAssociateWords(String key);




}
